
<template>
  <div>
    <p>子组件name: {{name}}</p>
    <div @click="clickChange">点击sync</div>
  </div>
</template>

<script>
export default {
  name: 'Son',
  props: {
    name: {
      type: String,
      default: ''
    }
  },
  computed: {
    compuName: {
      get() {
        return this.name
      },
      set() {
        this.$emit('update:name', '子组件修改leyo')
      }
    }
  },
  methods: {
    clickChange() {
      this.compuName = '子组件修改leyo'
    }
  }
}
</script>
